<%@ page  contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="page" uri="http://www.forten.org/taglib/page"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="forten" uri="http://www.forten.org/taglib/forten"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理人员选课</title>
<!-- CSS -->
<link type="text/css" rel="stylesheet" href="../styles/css/reset.css">
<link type="text/css" rel="stylesheet" href="../styles/css/index.css">
<link type="text/css" rel="stylesheet" href="../styles/css/button.css">
<link type="text/css" rel="stylesheet" href="../styles/css/index.css">
<script type="text/javascript" src="../scripts/html5.js"></script>
<!-- end -->
</head>
<body>
	<script type="text/javascript">
		function doQuery() {
			document.frm1.action = "showCadreList.jspx";
			document.frm1.submit();
		}
		function doSubmit(e) {
			var isSubmit = false;
			var boxes = document.getElementsByName(e);
			for ( var i = 0; i < boxes.length; i++) {
				if (boxes[i].checked == true) {
					isSubmit = true;
					break;
				}
			}
			if (isSubmit) {
				document.frm2.action = "gotoCourseSelectionResults.jspx";
				document.frm2.submit();
			} else {
				alert("您没有选择任何需要选课的人员！请确认您选择好后再做此操作。");
			}
		}

		function doSelect() {
			var pid = document.getElementsByName("pid");
			var selectBut = document.getElementById("selectAllButton");
			if (selectBut.value == "全选") {
				for (i = 0; i < pid.length; i++) {
					pid[i].checked = true;
				}
				selectBut.value = "取消";
			} else {
				for (i = 0; i < pid.length; i++) {
					pid[i].checked = false;
				}
				selectBut.value = "全选";
			}
		}
		/* function doSubmit(){
		 document.frm2.action="gotoCourseSelectionResults.jspx";
		 document.frm2.submit();
		} */
	</script>
	<header>
	<div class="headerWrap"></div>
	</header>

	<div class="content">

		<section>
		<div class="rc_info mt20">
			<h3>
				<span class="r_title_ico"></span>当前所选课程信息
			</h3>
		</div>
		<table class="rc_tab01" cellspacing="0" cellpadding="0"
			style="width: 80%;">
			<tbody>
				<tr>
					<th style="text-align: center;">课程号</th>
					<th style="text-align: center;">课程名</th>
					<th style="text-align: center;">教师</th>
					<th style="text-align: center;">学时</th>
				</tr>
				<tr>
					<td style="text-align: center;">${dtoCourse.num }</td>
					<td style="text-align: center;">${dtoCourse.name }</td>
					<td style="text-align: center;">${dtoCourse.teacherName }</td>
					<td style="text-align: center;">${dtoCourse.credit }</td>
				</tr>
			</tbody>
		</table>
		<br>
		<div class="rc_fbt">
			<form:form id="frm1" name="frm1" modelAttribute="cadreListQo"
				action="showCadreList.jspx">
				<span class="left"> <span class="ml15 mr5 left">工作证号</span> <form:input
						path="cardNum" class="s_txt left mt13" /> <span
					class="mlr15 left">姓名</span> <form:input path="name"
						class="s_txt ml5 left mt13" /> <span class="mlr15 left">级别</span>
					<form:select path="jobLevel" class="left mt13">
						<form:option label="---请选择---" value=""></form:option>
						<form:option value="1">副部级</form:option>
						<form:option value="2">正局级</form:option>
						<form:option value="3">副局级</form:option>
						<form:option value="4">正处级</form:option>
						<form:option value="5">副处级</form:option>
						<form:option value="6">正科级</form:option>
						<form:option value="7">副科级</form:option>
					</form:select> <a class="btn_search ml10 left mt10" href="#" onclick="doQuery();"></a>
				</span>
			</form:form>
		</div>
		

		<div class="rc_info mt20">
			<h3>
				<span class="r_title_ico"></span>请选择需要选课的干部名单
			</h3>
		</div>


		<form id="frm2" name="frm2" method="post"
			action="gotoCourseSelectionResults.jspx">
			<table class="rc_tab01" cellspacing="0" cellpadding="0">
				<tbody>
					<tr>
					<forten:token name="cadrechoose" returnUrl="gotoCourseSelectionAdmin.jspx"></forten:token>
						<th style="text-align: center;"><input type="button"
							id="selectAllButton" name="button111" value="全选" class="button"
							onclick="doSelect();" /></th>
						<th style="text-align: center;">干部工作证号</th>
						<th style="text-align: center;">姓名</th>
						<th style="text-align: center;">性别</th>
						<th style="text-align: center;">院系部处</th>
						<th style="text-align: center;">级别</th>
					</tr>
					<c:forEach items="${dto}" var="dto" varStatus="s">
						<tr>
							<td style="text-align: center;"><input type="checkbox"
								name="pid" value="${dto.id}" /></td>
							<td style="text-align: center;">${dto.cardNum}</td>
							<td style="text-align: center;">${dto.name}</td>
							<td style="text-align: center;">${dto.sex}</td>
							<td style="text-align: center;">${dto.unitName}</td>
							<c:if test="${dto.jobLevel == 1}">
								<td style="text-align: center;">副部级</td>
							</c:if>
							<c:if test="${dto.jobLevel == 2}">
								<td style="text-align: center;">正局级</td>
							</c:if>
							<c:if test="${dto.jobLevel == 3}">
								<td style="text-align: center;">副局级</td>
							</c:if>
							<c:if test="${dto.jobLevel == 4}">
								<td style="text-align: center;">正处级</td>
							</c:if>
							<c:if test="${dto.jobLevel == 5}">
								<td style="text-align: center;">副处级</td>
							</c:if>
							<c:if test="${dto.jobLevel == 6}">
								<td style="text-align: center;">正科级</td>
							</c:if>
							<c:if test="${dto.jobLevel == 7}">
								<td style="text-align: center;">副科级</td>
							</c:if>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		<page:page hrefStr="showCadreList.jspx" name="page"></page:page>
			<div class="rc_fbt">
				<p class="right">
					<a class="btn2 mt7" href="#" onclick="doSubmit('pid');"> <span>确认</span>
					</a>
				</p>
				<p class="right">
					<a class="btn2 mt7" href="gotoCourseSelectionAdmin.jspx"> <span>返回</span>
					</a>
				</p>
			</div>
		</form>

		<p class="right">
		</section>
		<!-- cont end -->
	</div>

<%@include file="/common/foot.jsp"%>